package tedu;

import java.util.Scanner;

public class Factorial {
    public static void main(String[] args) {
        System.out.println("输入你想求得阶乘");
        int a=new Scanner(System.in).nextInt();
        long b=f(a);
        System.out.println(a+"的阶乘是:"+b);
    }
    public static long f(int n){
        if(n==1){
            return n;
        }else{
            //递归
            return n*f(n-1);
        }
    }
}

